//
// Created by 77873 on 2020/10/12 0012.
//

#ifndef FFMPEGVIDEOPLAYER_DATAQUEUE_H
#define FFMPEGVIDEOPLAYER_DATAQUEUE_H

#include "queue"
#include "pthread.h"
#include "PlayStatus.h"
#include "AndroidLog.h"


extern "C" {
#include <libavcodec/avcodec.h>
};

class DataQueue {

public:
    std::queue<AVPacket *> queuePacket;

    pthread_mutex_t pthreadMutex;
    pthread_cond_t pthreadCond;

    PlayStatus *playStatus=NULL;
public:
    DataQueue(PlayStatus *ps);
    ~DataQueue();

    int pushAvpacket(AVPacket *pkt);

    int popAvpacket(AVPacket *pkt);

    int getQueueSIze();

    void clearAvpacket();
    void  noticeQueue();
};


#endif //FFMPEGVIDEOPLAYER_DATAQUEUE_H
